package com.smartthinking.dive;

import java.util.ArrayList;
import java.util.Dictionary;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class AcercaDe extends Activity{

	TextView text;
	Button telefono;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.acercade);
		text = (TextView) findViewById(R.id.textViewpag);
		telefono = (Button) findViewById(R.id.txttelefono);
	
		ArrayList<Dictionary<String, String> > listatel = null;

		String url7="select * from telefono";
		listatel = Utilities.qry2(getApplicationContext(),url7);
//		listatel.get(0).get("tel_num");
		final StringBuilder tel = new StringBuilder();
		tel.append(listatel.get(0).get("tel_num")+" ");
		
		telefono.setText(tel);
		
		telefono.setOnClickListener(new View.OnClickListener() {
			public void onClick(View arg0)
			{
				try {
//					String numero = traerNumero(listatel);
					Intent intent1 = new Intent(Intent.ACTION_CALL);
					intent1.setData(Uri.parse("tel:"+tel));
					startActivity(intent1);
				} catch (ActivityNotFoundException activityException) {
				}
			}
		});
	text.setOnClickListener(new View.OnClickListener() {
		public void onClick(View arg0)
		{
			Intent intent = new Intent(AcercaDe.this,PaginaAcercaDe.class);
			startActivity(intent);
		}
	});
	}
}
